﻿using UnityEngine;
using System.Collections;

public class Timer : MonoBehaviour
{

	public int timeLimitInSeconds = 60;
	public TextMesh textMesh;
	
	public bool levelCompleted = false;
	// Update is called once per frame
	void Update () {
		textMesh.text = Mathf.RoundToInt(timeLimitInSeconds - Time.timeSinceLevelLoad).ToString();
		if(Time.timeSinceLevelLoad > timeLimitInSeconds)
		{
			if(PickingUp.score==0){
				Application.LoadLevel("GameOver");
			}
		}
	}
}